package py.com.alfa.escriba.web.services;

import java.util.List;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import py.com.alfa.escriba.exception.ServiceException;
import py.com.alfa.escriba.persistence.dto.admin.UsuarioDTO;
import py.com.alfa.escriba.web.interceptor.InvocationContext;

public interface UsuarioService {
	
	List<UsuarioDTO> listUsuario(InvocationContext ic) throws ServiceException;
	
	UsuarioDTO getUsuario(Long id, InvocationContext ic) throws ServiceException;
	
	UsuarioDTO validaUsuario(String usuario, String password, InvocationContext ic) throws ServiceException;
	
	void deleteUsuario(Long id, InvocationContext ic) throws ServiceException;
	
	@Transactional(value="transactionManager", rollbackFor={ServiceException.class},propagation=Propagation.REQUIRED)
	UsuarioDTO updateUsuario(Long id, UsuarioDTO dto, InvocationContext ic) throws ServiceException;
	
	@Transactional(value="transactionManager", rollbackFor={ServiceException.class},propagation=Propagation.REQUIRED)
	UsuarioDTO createUsuario(UsuarioDTO dto, InvocationContext ic) throws ServiceException;
	
	@Transactional(value="transactionManager", rollbackFor={ServiceException.class},propagation=Propagation.REQUIRED)
	UsuarioDTO actualizarClave(Long id, UsuarioDTO dto, InvocationContext ic) throws ServiceException;
	
}